import request from "@/utils/request";
export const service = () => {
  return !!JSON.parse(localStorage.$loginInfo).tenantId ? "/event" : "/ttevent";
};

//调度步骤-选择人员的人员组织树
export function getUserTree(query) {
  return request({
    url: "/event/flow/alarm/getFlowByIdUserTree",
    method: "post",
    data: query,
  });
}

//'/order/getOrderInfo'
export function getOrderInfo(query) {
  return request({
    url: service() + "/alarm/order/getOrderInfo",
    method: "post",
    data: query,
  });
}
// /video/getVideoPlaybackUrl
export function getVideoPlaybackUrl(data) {
  return request({
    data,
    url: `/video/getVideoPlaybackUrl`,
    method: "post",
  });
}
// /flow/alarm/queryFlowLink
export function queryFlowLink(data) {
  return request({
    data,
    url: service() + `/flow/alarm/queryFlowLink`,
    method: "post",
  });
}
// /flow/alarm/queryNextLink
export function queryNextLink(data) {
  return request({
    data,
    url: service() + `/flow/alarm/queryNextLink`,
    method: "post",
  });
}
// /flow/order/queryRollbackLink
export function queryRollbackLink(data) {
  return request({
    data,
    url: service() + `/flow/order/queryRollbackLink`,
    method: "post",
  });
}
// /system/custorgan/getCustOrganTreeNew
export function getCustOrganTreeNew(data) {
  return request({
    data,
    url: `/admin/system/tenantDept/listSubsetDept`,
    method: "post",
  });
}
// /gridKeeper/getUserByTenantIdNew
export function getUserByTenantIdNew(data) {
  return request({
    data,
    url: service() + `/video/base/getLeaderByTenantId`,
    method: "post",
  });
}
// /alarm/order/sendAlarmOrder
export function sendAlarmOrder(data) {
  return request({
    data,
    url: service() + `/alarm/order/sendAlarmOrder`,
    method: "post",
  });
}
// /alarm/orderApprove/submitOrderApproveInfo
export function submitOrderApproveInfo(data) {
  return request({
    data,
    url: service() + `/alarm/orderApprove/submitOrderApproveInfo`,
    method: "post",
  });
}
// /alarm/orderApprove/submitOrderApproveInfo
export function signSubmitOrderApproveInfo(data) {
  return request({
    data,
    url: service() + `/alarm/orderApprove/signSubmitOrderApproveInfo`,
    method: "post",
  });
}
export function queryLastProcess(data) {
  return request({
    data,
    url: service() + `/flow/order/queryLastProcess`,
    method: "post",
  });
}
